package com.example;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

/**
 * Created by Administrator on 2018/5/16.
 */

public class SecondActivity extends AppCompatActivity implements View.OnClickListener {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        initView();
    }

    private void initView() {
        Button but1=findViewById(R.id.bt_JSQ);
        but1.setOnClickListener(this);
        Button but2=findViewById(R.id.bt_PN);
        but2.setOnClickListener(this);
        Button but3=findViewById(R.id.bt_Pic);
        but3.setOnClickListener(this);
        Button but4=findViewById(R.id.bt_Weather);
        but4.setOnClickListener(this);
        Button but5=findViewById(R.id.bt_music);
        but5.setOnClickListener(this);
        Button but6=findViewById(R.id.bt_movie);
        but6.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id =view.getId();
        switch (id){
            case R.id.bt_JSQ:
                Intent intent =new Intent(this,JSQActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_PN:
                Intent intent1 =new Intent(this,PhoneActivity.class);
                startActivity(intent1);
                break;
            case R.id.bt_Pic:
                Toast.makeText(this,"功能暂未开放",Toast.LENGTH_SHORT).show();
                break;
            case R.id.bt_Weather:
                Toast.makeText(this,"功能暂未开放",Toast.LENGTH_SHORT).show();
                break;
            case R.id.bt_music:
                Toast.makeText(this,"功能暂未开放",Toast.LENGTH_SHORT).show();
                break;
            case R.id.bt_movie:
                Toast.makeText(this,"功能暂未开放",Toast.LENGTH_SHORT).show();
                break;
        }

    }
}
